const tip = {
  toast: (title, duration = 1000, icon = "none") => {
    setTimeout(() => {
      uni.showToast({
        title: title,
        icon: icon,
        mask: true,
        duration: duration
      });
    }, 300)
  },
  error: (errorMessage) => {
    tip.toast(errorMessage || '校验错误', 2000);
  },
  loading: (title = "加载中", duration = 1000) => {
    uni.showToast({
      title: title,
      icon: "loading",
      mask: true,
      duration: duration
    });
  },
  hide: () => {
    uni.hideToast();
  },
}

export default tip;
